/**
 * @className: OvertimeController
 * @author: Csh
 * @date: 2024/4/1 21:13
 * @Version: 1.0
 * @description:
 */
package com.zhuojy.equity.mall.admin.web.controller.AttendanceControllers;

import com.zhuojy.equity.mall.admin.common.entity.bo.OvertimeBO;
import com.zhuojy.equity.mall.admin.common.pojo.JsonResult;
import com.zhuojy.equity.mall.admin.service.AttendanceServices.OvertimeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RestController
@RequestMapping("overtime")
@Api(tags = "加班模块")
@RequiredArgsConstructor
public class OvertimeController {
    @Autowired
    private OvertimeService overtimeService;

    @RequestMapping("addOrUpOvertime")
    @ApiOperation(value = "加班新增/修改",httpMethod = "POST")
    int addOrUpOvertime(@RequestBody OvertimeBO overtimeBO){
        return overtimeService.addOrUpOvertime(overtimeBO);
    }

    @RequestMapping("findAllOvertime")
    @ApiOperation(value = "分页条差加班信息",httpMethod = "POST")
    JsonResult findAllOvertime(@RequestBody OvertimeBO overtimeBO,@RequestParam(value = "pageNum",defaultValue = "1")Integer pageNum,@RequestParam(value = "pageSize",defaultValue = "100")Integer pageSize){
        return overtimeService.findAllOvertime(overtimeBO,pageNum,pageSize);
    }

    @RequestMapping("findOvertimeOne")
    @ApiOperation(value = "查询单个加班信息",httpMethod = "GET")
    JsonResult findOvertimeOne(@RequestParam(value = "id")Integer id){
        return overtimeService.findOvertimeOne(id);
    }

    @RequestMapping("delOvertime")
    @ApiOperation(value = "删除加班信息",httpMethod = "GET")
    int delOvertime(@RequestParam(value = "id")Integer id){
        return overtimeService.delOvertime(id);
    }
}
